\subsection{Additive categories}
In this section, we will study categories enriched over \( (\mathbf{AbGp}, \otimes, \mathbb Z) \); these are called \emph{additive} categories.
We will also consider other weaker enrichments: a category enriched over \( (\mathbf{Set}_\star, \wedge, 2) \) is called \emph{pointed}, and a category enriched over \( (\mathbf{CMon}, \otimes, \mathbb N) \), where \( \mathbf{CMon} \) is the category of commutative monoids, is called \emph{semi-additive}.

In a pointed category \( \mathcal C \), each \( \mathcal C(A, B) \) has a distinguished element 0, and all composites with zero morphisms are zero morphisms.
In a semi-additive category \( \mathcal C \), each \( \mathcal C(A, B) \) has a binary addition operation which is associative, commutative, and has an identity \( 0 \).
Composition in a semi-additive category is bilinear, so \( (f + g)(h + k) = fh + gh + fk + gk \) whenever the composites are defined.
In an additive category, each morphism \( f \in \mathcal C(A, B) \) has an additive inverse \( -f \in \mathcal C(A, B) \).
\begin{lemma}
    \begin{enumerate}
        \item For an object \( A \) in a pointed category \( \mathcal C \), the following are equivalent.
        \begin{enumerate}
            \item \( A \) is a terminal object of \( \mathcal C \).
            \item \( A \) is an initial object of \( \mathcal C \).
            \item \( 1_A = 0 : A \to A \).
        \end{enumerate}
        \item For objects \( A, B, C \) in a semi-additive category \( \mathcal C \), the following are equivalent.
        \begin{enumerate}
            \item there exist morphisms \( \pi_1 : C \to A \) and \( \pi_2 : C \to B \) making \( C \) into a product of \( A \) and \( B \);
            \item there exist morphisms \( \nu_1 : A \to C \) and \( \nu_2 : B \to C \) making \( C \) into a coproduct of \( A \) and \( B \);
            \item there exist morphisms \( \pi_1 : C \to A, \pi_2 : C \to B, \nu_1 : A \to C, \nu_2 : B \to C \) satisfying
            \[ \pi_1 \nu_1 = 1_A;\quad \pi_2 \nu_2 = 1_B;\quad \pi_1 \nu_2 = 0;\quad \pi_2 \nu_1 = 0;\quad \nu_1 \pi_1 + \nu_2 \pi_1 = 1_C \]
        \end{enumerate}
    \end{enumerate}
\end{lemma}
\begin{proof}
    In each part, as (a) and (b) are dual and (c) is self-dual, it suffices to prove the equivalence of (a) and (c).

    \emph{Part (i).}
    If \( A \) is terminal, then it has exactly one morphism \( A \to A \), so this must be the zero morphism.
    Conversely, if \( 1_A = 0 \), then \( A \) is terminal, as for any \( f : B \to A \), we have \( f = 1_A f = 0 f = 0 \), so the only morphism \( B \to A \) is the zero morphism.

    \emph{Part (ii).}
    If (a) holds, take \( \nu_1, \nu_2 \) to be defined by the first four equations in (c); it suffices to verify the last equation, \( \nu_1 \pi_1 + \nu_2 \pi_2 = 1_C \).
    Composing with \( \pi_1 \),
    \[ \pi_1 \nu_1 \pi_1 = 1_A \pi_1 + 0 \pi_2 = \pi_1 \]
    and similarly, composing with \( \pi_2 \) gives \( \pi_2 \).
    So by uniqueness of factorisations through limit cones, \( \nu_1 \pi_1 + \nu_2 \pi_2 \) must be the identity.
    Conversely, if (c) holds, given a pair \( f : D \to A \) and \( g : D \to B \), the morphism
    \[ h = \nu_1 f + \nu_2 g \]
    satisfies
    \[ \pi_1 h = 1_A f + 0 g = f;\quad \pi_2 h = 0 f + 1_A g = g \]
    giving a factorisation, and if \( h' \) also satisfies these equations, then
    \[ h' = (\nu_1 \pi_1 + \nu_2 \pi_2) h' = \nu_1 f + \nu_2 g = h \]
    so the factorisation is unique.
\end{proof}
In any category, an object which is both initial and terminal is called a \emph{zero object}, denoted \( 0 \).
An object that is a product and a coproduct of \( A \) and \( B \) is called a \emph{biproduct}, denoted \( A \oplus B \).
\begin{lemma}
    Let \( \mathcal C \) be a locally small category.
    \begin{enumerate}
        \item If \( \mathcal C \) has a zero object, then it has a unique pointed structure.
        \item Suppose \( \mathcal C \) has a zero object and has binary products and coproducts.
        Suppose further that for each pair \( A, B \in \ob \mathcal C \), the canonical morphism \( c : A + B \to A \times B \) defined by
        \[ \pi_i c \nu_j = \begin{cases}
            1 & \text{if } i = j \\
            0 & \text{if } i \neq j
        \end{cases} \]
        is an isomorphism.
        Then \( \mathcal C \) has a unique semi-additive structure.
    \end{enumerate}
\end{lemma}
We adopt the convention that morphisms into a product are denoted with column vectors, and morphisms out of a product are denoted with row vectors.
\begin{proof}
    \emph{Part (i).}
    The unique morphism \( 0 \to 0 \) is both the identity and a zero morphism.
    So for any two \( A, B : \ob \mathcal C \), the unique composite \( A \to 0 \to B \) must be the zero element of \( \mathcal C(A, B) \).
    We can define a pointed structure on \( \mathcal C \) in this way.

    \emph{Part (ii).}
    This technique is known as the \emph{Eckmann--Hilton argument}.
    Given \( f, g : A \rightrightarrows B \), we define the \emph{left sum} \( f +_\ell g \) to be the composite
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCJBIl0sWzEsMCwiQiBcXHRpbWVzIEIiXSxbMiwwLCJCK0IiXSxbMywwLCJCIl0sWzAsMSwiXFxiZWdpbntwbWF0cml4fWYgXFxcXCBnXFxlbmR7cG1hdHJpeH0iXSxbMSwyLCJjXnstMX0iXSxbMiwzLCJcXGJlZ2lue3BtYXRyaXh9MSYxXFxlbmR7cG1hdHJpeH0iXV0=
\[\begin{tikzcd}[ampersand replacement=\&]
	A \& {B \times B} \& {B+B} \& B
	\arrow["{\begin{pmatrix}f \\ g\end{pmatrix}}", from=1-1, to=1-2]
	\arrow["{c^{-1}}", from=1-2, to=1-3]
	\arrow["{\begin{pmatrix}1&1\end{pmatrix}}", from=1-3, to=1-4]
\end{tikzcd}\]
    and the \emph{right sum} \( f +_r g \) to be
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCJBIl0sWzEsMCwiQSBcXHRpbWVzIEEiXSxbMiwwLCJCK0IiXSxbMywwLCJCIl0sWzAsMSwiXFxiZWdpbntwbWF0cml4fTEgXFxcXCAxXFxlbmR7cG1hdHJpeH0iXSxbMSwyLCJjXnstMX0iXSxbMiwzLCJcXGJlZ2lue3BtYXRyaXh9ZiZnXFxlbmR7cG1hdHJpeH0iXV0=
\[\begin{tikzcd}[ampersand replacement=\&]
	A \& {A \times A} \& {B+B} \& B
	\arrow["{\begin{pmatrix}1 \\ 1\end{pmatrix}}", from=1-1, to=1-2]
	\arrow["{c^{-1}}", from=1-2, to=1-3]
	\arrow["{\begin{pmatrix}f&g\end{pmatrix}}", from=1-3, to=1-4]
\end{tikzcd}\]
    Note that \( (f +_\ell g)h = fh +_\ell gh \), since
    \[ \begin{pmatrix}
        f \\ g
    \end{pmatrix} h = \begin{pmatrix}
        fh \\ gh
    \end{pmatrix} \]
    and similarly,
    \[ k(f +_r g) = kf +_r kg \]
    So if we show that the two sums coincide, we obtain the required distributive laws.
    First, note that \( 0 : A \to B \) is a two-sided identity for both \( +_\ell \) and \( +_r \).
    For example, \( f +_\ell 0 = f \), since
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCJBIl0sWzEsMSwiQiBcXHRpbWVzIEIiXSxbMiwwLCJCIl0sWzMsMSwiQiArIEIiXSxbNCwwLCJCIl0sWzAsMSwiXFxiZWdpbntwbWF0cml4fWYgXFxcXCAwXFxlbmR7cG1hdHJpeH0iLDJdLFswLDIsImYiXSxbMiwxLCJcXGJlZ2lue3BtYXRyaXh9MVxcXFwwXFxlbmR7cG1hdHJpeH0iXSxbMiwzLCJcXG51XzEiXSxbMSwzLCJjXnstMX0iLDJdLFsyLDQsIjFfQiJdLFszLDQsIlxcYmVnaW57cG1hdHJpeH0xJjFcXGVuZHtwbWF0cml4fSIsMl1d
\[\begin{tikzcd}[ampersand replacement=\&]
	A \&\& B \&\& B \\
	\& {B \times B} \&\& {B + B}
	\arrow["{\begin{pmatrix}f \\ 0\end{pmatrix}}"', from=1-1, to=2-2]
	\arrow["f", from=1-1, to=1-3]
	\arrow["{\begin{pmatrix}1\\0\end{pmatrix}}", from=1-3, to=2-2]
	\arrow["{\nu_1}", from=1-3, to=2-4]
	\arrow["{c^{-1}}"', from=2-2, to=2-4]
	\arrow["{1_B}", from=1-3, to=1-5]
	\arrow["{\begin{pmatrix}1&1\end{pmatrix}}"', from=2-4, to=1-5]
\end{tikzcd}\]
    commutes.
    Suppose we have morphisms \( f, g, h, k : A \to B \), and consider the composite
    % https://q.uiver.app/#q=WzAsNixbMCwwLCJBIl0sWzEsMCwiQSBcXHRpbWVzIEEiXSxbMiwwLCJBICsgQSJdLFszLDAsIkIgXFx0aW1lcyBCIl0sWzQsMCwiQiArIEIiXSxbNSwwLCJCIl0sWzAsMSwiXFxiZWdpbntwbWF0cml4fTFcXFxcMVxcZW5ke3BtYXRyaXh9Il0sWzEsMiwiY157LTF9Il0sWzIsMywiXFxiZWdpbntwbWF0cml4fWYmZ1xcXFxoJmtcXGVuZHtwbWF0cml4fSJdLFszLDQsImNeey0xfSJdLFs0LDUsIlxcYmVnaW57cG1hdHJpeH0xJjFcXGVuZHtwbWF0cml4fSJdXQ==
\[\begin{tikzcd}[ampersand replacement=\&]
	A \& {A \times A} \& {A + A} \& {B \times B} \& {B + B} \& B
	\arrow["{\begin{pmatrix}1\\1\end{pmatrix}}", from=1-1, to=1-2]
	\arrow["{c^{-1}}", from=1-2, to=1-3]
	\arrow["{\begin{pmatrix}f&g\\h&k\end{pmatrix}}", from=1-3, to=1-4]
	\arrow["{c^{-1}}", from=1-4, to=1-5]
	\arrow["{\begin{pmatrix}1&1\end{pmatrix}}", from=1-5, to=1-6]
\end{tikzcd}\]
    The composite of the first three factors is
    \[ \begin{pmatrix}
        f +_r g \\
        h +_r k
    \end{pmatrix} \]
    so the whole composite is \( (f +_r g) +_\ell (h +_r k) \).
    Evaluating from other end, we obtain
    \[ (f +_r g) +_\ell (h +_r k) = (f +_\ell h) +_r (g +_\ell k) \]
    This is known as the \emph{interchange law}.
    Substituting \( g = k = 0 \), we obtain \( f +_\ell k = f +_r k \).
    Substituting \( f = k = 0 \) (and dropping the subscripts) we obtain the commutative law \( g + h = h + g \).
    Substituting \( h = 0 \), we obtain the associativity law \( (f + g) + k = f + (g + k) \).

    For uniqueness, suppose we have some semi-additive structure \( + \) on \( \mathcal C \).
    Then \( \nu_1 \pi_1 + \nu_2 \pi_2 \) must be the inverse of \( c = \begin{pmatrix}
        1 & 0 \\ 0 & 1
    \end{pmatrix} : A + B \to A \times B \), since
    \[ \nu_1 \pi_1 c = \nu_1 \begin{pmatrix}
        1 & 0
    \end{pmatrix} = \begin{pmatrix}
        \nu_1 & 0
    \end{pmatrix};\quad \nu_2 \pi_2 c =\begin{pmatrix}
        0 & \nu_2
    \end{pmatrix} \]
    so
    \[ (\nu_1 \pi_1 + \nu_2 \pi_2) c = \begin{pmatrix}
        \nu_1 + 0 & 0 + \nu_2
    \end{pmatrix} = \begin{pmatrix}
        \nu_1 & \nu_2
    \end{pmatrix} = 1_{A + B} \]
    Hence the definitions of \( +_\ell \) and \( +_r \) both reduce to \( + \).
\end{proof}
Note that if \( \mathcal C \) and \( \mathcal D \) are semi-additive categories with finite biproducts, then a functor \( F : \mathcal C \to \mathcal D \) is semi-additive (that is, enriched over \( \mathbf{CMon} \)) if and only if it preserves either finite products or finite coproducts.
In particular, if \( F \) has either a left or right adjoint, then it is semi-additive, and the adjunction is enriched over \( \mathbf{CMon} \); the bijection \( \mathcal C(A, GB) \to \mathcal D(FA, B) \) is an isomorphism of commutative monoids, since the operations \( F(-) \) and \( (-) \epsilon_B \) both respect addition.

\subsection{Kernels and cokernels}
\begin{definition}
    Let \( f : A \to B \) be a morphism in a pointed category \( \mathcal C \).
    The \emph{kernel} of \( f \) is the equaliser of the pair \( (f, 0) \); dually the \emph{cokernel} is the coequaliser of \( (f, 0) \).
    A monomorphism that occurs as the kernel of a morphism is called \emph{normal}.
\end{definition}
In an additive category, the normal monomorphisms are precisely the regular monomorphisms, since the equaliser of \( (f, g) \) is the kernel of \( f - g \).
In \( \mathbf{Gp} \), all inclusions of subgroups are regular, but not all inclusions are normal, since a normal monomorphism corresponds to a normal subgroup.
In \( \mathbf{Set}_\star \), all surjections are regular epimorphisms, but \( (A, a_0) \to (B, b_0) \) is a normal epimorphism if \( f \) is bijective on elements not mapped to \( b_0 \).
We say that a morphism \( f : A \to B \) is a \emph{pseudomonomorphism} if its kernel is a zero morphism; that is, \( fg = 0 \) implies \( g = 0 \).
\begin{lemma}
    In a pointed category with kernels and cokernels, \( f : A \to B \) is normal monic if and only if \( f \cong \ker \coker f \).
\end{lemma}
\begin{proof}
    If \( f \cong \ker \coker f \), it is clearly normal.
    Now suppose \( f = \ker g \).
    Then \( g \) factors through the cokernel of \( f \), so \( g (\ker \coker f) = 0 \).
    Thus \( \ker \coker f \leq f \) in \( \operatorname{Sub}(B) \).
    But \( (\coker f) f = 0 \), so \( f \leq \ker \coker f \), so they are isomorphic as subobjects of \( B \).
\end{proof}
\begin{corollary}
    In a pointed category with kernels and cokernels, the operations \( \ker \) and \( \coker \) induce an order-reversing bijection between isomorphism classes of normal subobjects and isomorphism classes of normal quotients of any object.
\end{corollary}
\begin{remark}
    For any morphism \( f : A \to B \) in such a category, \( \ker \coker f \) is the smallest normal subobject of \( B \) through which \( f \) factors.
\end{remark}

\subsection{Abelian categories}
\begin{definition}
    An \emph{abelian category} is an additive category with all finite limits and colimits.
    Equivalently, an abelian category is a category with a zero object, finite biproducts, kernels, and cokernels, such that all monomorphisms and epimorphisms are normal.
\end{definition}
\begin{example}
    \begin{enumerate}
        \item The category \( \mathbf{AbGp} \) is abelian; more generally, for any ring \( R \), the category \( \mathbf{Mod}_R \) is abelian.
        \item If \( \mathcal A \) is abelian and \( \mathcal C \) is small, then \( [\mathcal C, \mathcal A] \) is abelian, with all structures defined pointwise.
        \item If \( \mathcal A \) is abelian and \( \mathcal C \) is small and additive, then the category of additive functors \( \mathcal C \to \mathcal A \), denoted \( \operatorname{Add}(\mathcal C, \mathcal A) \), is also abelian, as it is closed under all of the structures on \( [\mathcal C, \mathcal A] \).
        Note that this covers the case of \( R \)-modules, as an additive category with a single object is a ring, and the category of modules over such a ring is isomorphic to the category of additive functors from this category to \( \mathbf{AbGp} \).
    \end{enumerate}
\end{example}
\begin{remark}
    If \( f : A \to B \) in an abelian category, then \( \ker \coker f \) is the smallest subobject \( I \rightarrowtail B \) through which \( f \) factors.
    This is called the \emph{image} of \( f \), denoted \( \im f = \ker \coker f \).
    The other part of the factorisation \( A \to I \) is epic, as it cannot factor through the equaliser of any nonequal parallel pair \( I \rightrightarrows C \).
    Thus, it is also the smallest quotient of \( A \) through which \( f \) factors, so it is the \emph{coimage} of \( f \), given by \( \coim f = \coker \ker f \).
    The composition \( A \twoheadrightarrow I \rightarrowtail B \) is the unique epi--mono factorisation of \( f \).
\end{remark}
To show that this factorisation is stable under pullback, it suffices to show that the pullback of an epimorphism in an abelian category is epic, as the corresponding statement for monomorphisms has already been shown.
\begin{lemma}[flattening lemma]
    Consider a square
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCJBIl0sWzEsMCwiQiJdLFsxLDEsIkQiXSxbMCwxLCJDIl0sWzAsMSwiZiJdLFsxLDIsImgiXSxbMCwzLCJnIiwyXSxbMywyLCJrIiwyXV0=
\[\begin{tikzcd}
	A & B \\
	C & D
	\arrow["f", from=1-1, to=1-2]
	\arrow["h", from=1-2, to=2-2]
	\arrow["g"', from=1-1, to=2-1]
	\arrow["k"', from=2-1, to=2-2]
\end{tikzcd}\]
    in an abelian category \( \mathcal A \).
    Its \emph{flattening} is the sequence
    % https://q.uiver.app/#q=WzAsMyxbMCwwLCJBIl0sWzEsMCwiQiBcXG9wbHVzIEMiXSxbMiwwLCJEIl0sWzAsMSwiXFxiZWdpbntwbWF0cml4fWZcXFxcZ1xcZW5ke3BtYXRyaXh9Il0sWzEsMiwiXFxiZWdpbntwbWF0cml4fWgmLWtcXGVuZHtwbWF0cml4fSJdXQ==
\[\begin{tikzcd}[ampersand replacement=\&]
	A \& {B \oplus C} \& D
	\arrow["{\begin{pmatrix}f\\g\end{pmatrix}}", from=1-1, to=1-2]
	\arrow["{\begin{pmatrix}h&-k\end{pmatrix}}", from=1-2, to=1-3]
\end{tikzcd}\]
    Then
    \begin{enumerate}
        \item the square commutes if and only if the composite of the flattening \( \begin{pmatrix}
            h & -k
        \end{pmatrix} \begin{pmatrix}
            f \\ g
        \end{pmatrix} \) is the zero morphism;
        \item the square is a pullback if and only if \( \begin{pmatrix}
            f \\ g
        \end{pmatrix} = \ker \begin{pmatrix}
            h & -k
        \end{pmatrix} \);
        \item the square is a pushout if and only if \( \begin{pmatrix}
            h & -k
        \end{pmatrix} = \coker \begin{pmatrix}
            f \\ g
        \end{pmatrix} \).
    \end{enumerate}
\end{lemma}
\begin{proof}
    \emph{Part (i).}
    The composite \( \begin{pmatrix}
        h & -k
    \end{pmatrix} \begin{pmatrix}
        f \\ g
    \end{pmatrix} \) is \( hf - kg \), so it vanishes if and only if the square commutes.

    \emph{Part (ii).}
    \( \begin{pmatrix}
        f \\ g
    \end{pmatrix} \) is the kernel of \( \begin{pmatrix}
        h & -k
    \end{pmatrix} \) if and only if
    % https://q.uiver.app/#q=WzAsMyxbMCwwLCJBIl0sWzEsMCwiQiJdLFswLDEsIkMiXSxbMCwxLCJmIl0sWzAsMiwiZyIsMl1d
\[\begin{tikzcd}
	A & B \\
	C
	\arrow["f", from=1-1, to=1-2]
	\arrow["g"', from=1-1, to=2-1]
\end{tikzcd}\]
    is universal among spans completing the cospan
    % https://q.uiver.app/#q=WzAsMyxbMSwwLCJCIl0sWzEsMSwiRCJdLFswLDEsIkMiXSxbMCwxLCJoIl0sWzIsMSwiayIsMl1d
\[\begin{tikzcd}
	& B \\
	C & D
	\arrow["h", from=1-2, to=2-2]
	\arrow["k"', from=2-1, to=2-2]
\end{tikzcd}\]
    into a commutative square.

    \emph{Part (iii).} Follows by duality, taking care of the asymmetric negation.
\end{proof}
\begin{corollary}
    In an abelian category \( \mathcal A \), epimorphisms are stable under pullback.
\end{corollary}
\begin{proof}
    Suppose we have a pullback square
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCJBIl0sWzEsMCwiQiJdLFsxLDEsIkQiXSxbMCwxLCJDIl0sWzAsMSwiZiJdLFsxLDIsImgiLDAseyJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJlcGkifX19XSxbMCwzLCJnIiwyXSxbMywyLCJrIiwyXV0=
\[\begin{tikzcd}
	A & B \\
	C & D
	\arrow["f", from=1-1, to=1-2]
	\arrow["h", two heads, from=1-2, to=2-2]
	\arrow["g"', from=1-1, to=2-1]
	\arrow["k"', from=2-1, to=2-2]
\end{tikzcd}\]
    By part (ii) of the above result, \( \begin{pmatrix}
        f \\ g
    \end{pmatrix} = \ker \begin{pmatrix}
        h & -k
    \end{pmatrix} \).
    But \( h \) is an epimorphism, so \( \begin{pmatrix}
        h & -k
    \end{pmatrix} \) is also an epimorphism.
    Thus \( \begin{pmatrix}
        h & -k
    \end{pmatrix} = \coker \begin{pmatrix}
        f \\ g
    \end{pmatrix} \), so the square is also a pushout.
    We show that \( g \) is a pseudoepimorphism; this suffices as \( \mathcal A \) is additive.
    Suppose we have \( \ell : C \to E \) with \( \ell g = 0 \).
    Then \( \begin{pmatrix}
        \ell & (B \xrightarrow 0 E)
    \end{pmatrix} \) factors uniquely through the pushout.
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCJBIl0sWzEsMCwiQiJdLFsxLDEsIkQiXSxbMCwxLCJDIl0sWzIsMiwiRSJdLFswLDEsImYiXSxbMSwyLCJoIiwwLHsic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoiZXBpIn19fV0sWzAsMywiZyIsMl0sWzMsMiwiayIsMl0sWzEsNCwiMCIsMCx7ImN1cnZlIjotMn1dLFszLDQsIlxcZWxsIiwyLHsiY3VydmUiOjJ9XSxbMiw0LCJtIl1d
\[\begin{tikzcd}
	A & B \\
	C & D \\
	&& E
	\arrow["f", from=1-1, to=1-2]
	\arrow["h", two heads, from=1-2, to=2-2]
	\arrow["g"', from=1-1, to=2-1]
	\arrow["k"', from=2-1, to=2-2]
	\arrow["0", curve={height=-12pt}, from=1-2, to=3-3]
	\arrow["\ell"', curve={height=12pt}, from=2-1, to=3-3]
	\arrow["m", from=2-2, to=3-3]
\end{tikzcd}\]
    But then \( mh = 0 \) and \( h \) is epic, so \( m = 0 \), giving \( \ell = mk = 0 \).
\end{proof}
Thus image factorisations are stable under pullback, and dually, under pushout.

\subsection{Exact sequences}
\begin{definition}
    A sequence% https://q.uiver.app/#q=WzAsNSxbMCwwLCJcXGNkb3RzIl0sWzEsMCwiQV97bisxfSJdLFsyLDAsIkFfbiJdLFszLDAsIkFfe24tMX0iXSxbNCwwLCJcXGNkb3RzIl0sWzAsMV0sWzEsMiwiZl97bisxfSJdLFsyLDMsImZfbiJdLFszLDRdXQ==
    \[\begin{tikzcd}
        \cdots & {A_{n+1}} & {A_n} & {A_{n-1}} & \cdots
        \arrow[from=1-1, to=1-2]
        \arrow["{f_{n+1}}", from=1-2, to=1-3]
        \arrow["{f_n}", from=1-3, to=1-4]
        \arrow[from=1-4, to=1-5]
    \end{tikzcd}\]
    in an abelian category \( \mathcal A \) is \emph{exact} at \( A_n \) if \( \ker f_n = \operatorname{im} f_{n+1} \).
    The entire sequence is said to be \emph{exact} if it is exact at every vertex.
\end{definition}
By duality, the sequence is exact at \( A_n \) if and only if \( \coker f_{n+1} = \coim f_n \).
\begin{example}
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCIwIl0sWzEsMCwiQSJdLFsyLDAsIkIiXSxbMywwLCJDIl0sWzAsMV0sWzEsMiwiZiJdLFsyLDMsImciXV0=
\[\begin{tikzcd}
	0 & A & B & C
	\arrow[from=1-1, to=1-2]
	\arrow["f", from=1-2, to=1-3]
	\arrow["g", from=1-3, to=1-4]
\end{tikzcd}\]
    is exact at \( A \) if and only if \( f \) is monic, and is exact at \( A \) and \( B \) if and only if \( f = \ker g \).
\end{example}
\begin{definition}
    A functor between abelian categories \( F : \mathcal A \to \mathcal B \) is \emph{exact} if it preserves arbitrary exact sequences.
\end{definition}
This implies that \( F \) preserves kernels and cokernels, and the converse is true as images are defined in terms of kernels and cokernels.
\begin{definition}
    \( F \) is \emph{left exact} if it preserves exact sequences of the form
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCIwIl0sWzEsMCwiQSJdLFsyLDAsIkIiXSxbMywwLCJDIl0sWzAsMV0sWzEsMiwiZiJdLFsyLDMsImciXV0=
\[\begin{tikzcd}
	0 & A & B & C
	\arrow[from=1-1, to=1-2]
	\arrow["f", from=1-2, to=1-3]
	\arrow["g", from=1-3, to=1-4]
\end{tikzcd}\]
\end{definition}
\begin{proposition}
    Let \( F : \mathcal A \to \mathcal B \) be a functor between abelian categories.
    Then
    \begin{enumerate}
        \item \( F \) is left exact if and only if it preserves all finite limits (and hence is additive);
        \item \( F \) is exact if and only if it is left exact and preserves epimorphisms.
    \end{enumerate}
\end{proposition}
\begin{proof}
    \emph{Part (i).}
    One direction is trivial as kernels are finite limits.
    Conversely, note that for any \( A, B \), the sequence
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiQSJdLFsyLDAsIkEgXFxvcGx1cyBCIl0sWzMsMCwiQiJdLFs0LDAsIjAiXSxbMCwxXSxbMSwyLCJcXGJlZ2lue3BtYXRyaXh9MVxcXFwwXFxlbmR7cG1hdHJpeH0iXSxbMiwzLCJcXGJlZ2lue3BtYXRyaXh9MCYxXFxlbmR7cG1hdHJpeH0iXSxbMyw0XV0=
\[\begin{tikzcd}[ampersand replacement=\&]
	0 \& A \& {A \oplus B} \& B \& 0
	\arrow[from=1-1, to=1-2]
	\arrow["{\begin{pmatrix}1\\0\end{pmatrix}}", from=1-2, to=1-3]
	\arrow["{\begin{pmatrix}0&1\end{pmatrix}}", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    is exact, and conversely, if we have an exact sequence
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiQSJdLFsyLDAsIkMiXSxbMywwLCJCIl0sWzQsMCwiMCJdLFswLDFdLFsxLDIsImYiXSxbMiwzLCJnIl0sWzMsNF1d
\[\begin{tikzcd}
	0 & A & C & B & 0
	\arrow[from=1-1, to=1-2]
	\arrow["f", from=1-2, to=1-3]
	\arrow["g", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    and either \( f \) is a split monomorphism or \( g \) is a split epimorphism, then \( C \cong A \oplus B \).
    Indeed, suppose that \( f \) is split, so \( rf = 1_A \).
    Then \( g = \coker f = \coker fr \) is the equaliser of \( (1_C-fr, 1_C) \), so it is the epic part of a splitting of the idempotent \( 1_C - fr \).
    If \( s : B \to C \) is the monic part of this splitting, then the four morphisms \( (r, g, f, s) \) satisfy the equations of a biproduct.
    So \( F \) maps
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiQSJdLFsyLDAsIkEgXFxvcGx1cyBCIl0sWzMsMCwiQiJdLFs0LDAsIjAiXSxbMCwxXSxbMSwyLCJcXGJlZ2lue3BtYXRyaXh9MVxcXFwwXFxlbmR7cG1hdHJpeH0iXSxbMiwzLCJcXGJlZ2lue3BtYXRyaXh9MCYxXFxlbmR7cG1hdHJpeH0iXSxbMyw0XV0=
\[\begin{tikzcd}[ampersand replacement=\&]
	0 \& A \& {A \oplus B} \& B \& 0
	\arrow[from=1-1, to=1-2]
	\arrow["{\begin{pmatrix}1\\0\end{pmatrix}}", from=1-2, to=1-3]
	\arrow["{\begin{pmatrix}0&1\end{pmatrix}}", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    to a sequence identifying \( F(A \oplus B) \) as \( FA \oplus FB \), and thus preserves biproducts.
    Hence \( F \) preserves all finite limits.

    \emph{Part (ii).}
    If \( F \) is left exact and preserves epimorphisms, then it preserves the exactness of sequences of the form
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiQSJdLFsyLDAsIkMiXSxbMywwLCJCIl0sWzQsMCwiMCJdLFswLDFdLFsxLDIsImYiXSxbMiwzLCJnIl0sWzMsNF1d
\[\begin{tikzcd}
	0 & A & C & B & 0
	\arrow[from=1-1, to=1-2]
	\arrow["f", from=1-2, to=1-3]
	\arrow["g", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    Thus it preserves kernels and cokernels.
\end{proof}

\subsection{The five lemma}
\begin{lemma}
    Suppose we have a commutative diagram in an abelian category
    % https://q.uiver.app/#q=WzAsMTAsWzAsMCwiQV8xIl0sWzEsMCwiQV8yIl0sWzIsMCwiQV8zIl0sWzMsMCwiQV80Il0sWzQsMCwiQV81Il0sWzQsMSwiQl81Il0sWzAsMSwiQl8xIl0sWzEsMSwiQl8yIl0sWzIsMSwiQl8zIl0sWzMsMSwiQl80Il0sWzAsMSwiZl8xIl0sWzEsMiwiZl8yIl0sWzIsMywiZl8zIl0sWzMsNCwiZl80Il0sWzQsNSwidV81Il0sWzAsNiwidV8xIl0sWzYsNywiZ18xIiwyXSxbNyw4LCJnXzIiLDJdLFs4LDksImdfMyIsMl0sWzksNSwiZ180IiwyXSxbMSw3LCJ1XzIiXSxbMiw4LCJ1XzMiXSxbMyw5LCJ1XzQiXV0=
\[\begin{tikzcd}
	{A_1} & {A_2} & {A_3} & {A_4} & {A_5} \\
	{B_1} & {B_2} & {B_3} & {B_4} & {B_5}
	\arrow["{f_1}", from=1-1, to=1-2]
	\arrow["{f_2}", from=1-2, to=1-3]
	\arrow["{f_3}", from=1-3, to=1-4]
	\arrow["{f_4}", from=1-4, to=1-5]
	\arrow["{u_5}", from=1-5, to=2-5]
	\arrow["{u_1}", from=1-1, to=2-1]
	\arrow["{g_1}"', from=2-1, to=2-2]
	\arrow["{g_2}"', from=2-2, to=2-3]
	\arrow["{g_3}"', from=2-3, to=2-4]
	\arrow["{g_4}"', from=2-4, to=2-5]
	\arrow["{u_2}", from=1-2, to=2-2]
	\arrow["{u_3}", from=1-3, to=2-3]
	\arrow["{u_4}", from=1-4, to=2-4]
\end{tikzcd}\]
    where the rows are exact sequences.
    Then,
    \begin{enumerate}
        \item if \( u_1 \) is epic and \( u_2, u_4 \) are monic, then \( u_3 \) is monic;
        \item if \( u_5 \) is monic and \( u_2, u_4 \) are spic, then \( u_3 \) is epic.
    \end{enumerate}
    Thus if \( u_1, u_2, u_4, u_5 \) are isomorphisms, \( u_3 \) is an isomorphism.
\end{lemma}
\begin{proof}
    By duality it suffices to show (i).
    We show \( u_3 \) is a pseudomonomorphism.
    Suppose we have \( x : C \to A_3 \) with \( u_3 x = 0 \).
    Then \( u_4 f_3 x = g_4 u_3 x = 0 \), so as \( u_4 \) is a monomorphism, \( f_3 x = 0 \).
    Hence \( x \) factors through the kernel of \( f_3 \), which is the image of \( f_2 \).
    Form the pullback of \( f_2 \) and \( x \) to obtain
    % https://q.uiver.app/#q=WzAsMTIsWzAsMSwiQV8xIl0sWzEsMSwiQV8yIl0sWzIsMSwiQV8zIl0sWzMsMSwiQV80Il0sWzAsMiwiQl8xIl0sWzEsMiwiQl8yIl0sWzIsMiwiQl8zIl0sWzMsMiwiQl80Il0sWzIsMCwiQyJdLFsxLDAsIkQiXSxbNCwyLCJCXzUiXSxbNCwxLCJBXzUiXSxbMCwxLCJmXzEiXSxbMSwyLCJmXzIiXSxbMiwzLCJmXzMiXSxbMCw0LCJ1XzEiXSxbNCw1LCJnXzEiLDJdLFs1LDYsImdfMiIsMl0sWzYsNywiZ18zIiwyXSxbMSw1LCJ1XzIiXSxbMiw2LCJ1XzMiXSxbMyw3LCJ1XzQiXSxbOCwyLCJ4Il0sWzksOCwieSJdLFs5LDEsInoiXSxbNywxMCwiZ180IiwyXSxbMywxMSwiZl80Il0sWzExLDEwLCJ1XzUiXV0=
\[\begin{tikzcd}
	& D & C \\
	{A_1} & {A_2} & {A_3} & {A_4} & {A_5} \\
	{B_1} & {B_2} & {B_3} & {B_4} & {B_5}
	\arrow["{f_1}", from=2-1, to=2-2]
	\arrow["{f_2}", from=2-2, to=2-3]
	\arrow["{f_3}", from=2-3, to=2-4]
	\arrow["{u_1}", from=2-1, to=3-1]
	\arrow["{g_1}"', from=3-1, to=3-2]
	\arrow["{g_2}"', from=3-2, to=3-3]
	\arrow["{g_3}"', from=3-3, to=3-4]
	\arrow["{u_2}", from=2-2, to=3-2]
	\arrow["{u_3}", from=2-3, to=3-3]
	\arrow["{u_4}", from=2-4, to=3-4]
	\arrow["x", from=1-3, to=2-3]
	\arrow["y", from=1-2, to=1-3]
	\arrow["z", from=1-2, to=2-2]
	\arrow["{g_4}"', from=3-4, to=3-5]
	\arrow["{f_4}", from=2-4, to=2-5]
	\arrow["{u_5}", from=2-5, to=3-5]
\end{tikzcd}\]
    Then \( y \) is also the pullback of this factorisation of \( x \) along \( \coim f_2 \), so \( y \) is an epimorphism as epimorphisms are stable under pullback.
    Then \( g_2 u_2 z = u_3 f_2 z = u_3 x y = 0 \).
    Thus \( u_2 z \) factors through \( \ker g_2 = \operatorname{im} g_1 \).
    Consider the pullback square
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCJFIl0sWzEsMCwiRCJdLFsxLDEsIkJfMiJdLFswLDEsIkFfMSJdLFswLDEsInYiXSxbMSwyLCJ1XzIgeiJdLFswLDMsInUiLDJdLFszLDIsImdfMSB1XzEiLDJdXQ==
\[\begin{tikzcd}
	E & D \\
	{A_1} & {B_2}
	\arrow["v", from=1-1, to=1-2]
	\arrow["{u_2 z}", from=1-2, to=2-2]
	\arrow["w"', from=1-1, to=2-1]
	\arrow["{g_1 u_1}"', from=2-1, to=2-2]
\end{tikzcd}\]
    So \( v \) is epic, as it is the pullback of \( \coim(g_1 u_1) \).
    % https://q.uiver.app/#q=WzAsMTMsWzAsMSwiQV8xIl0sWzEsMSwiQV8yIl0sWzIsMSwiQV8zIl0sWzMsMSwiQV80Il0sWzAsMiwiQl8xIl0sWzEsMiwiQl8yIl0sWzIsMiwiQl8zIl0sWzMsMiwiQl80Il0sWzIsMCwiQyJdLFsxLDAsIkQiXSxbNCwyLCJCXzUiXSxbNCwxLCJBXzUiXSxbMCwwLCJFIl0sWzAsMSwiZl8xIl0sWzEsMiwiZl8yIl0sWzIsMywiZl8zIl0sWzAsNCwidV8xIl0sWzQsNSwiZ18xIiwyXSxbNSw2LCJnXzIiLDJdLFs2LDcsImdfMyIsMl0sWzEsNSwidV8yIl0sWzIsNiwidV8zIl0sWzMsNywidV80Il0sWzgsMiwieCJdLFs5LDgsInkiXSxbOSwxLCJ6Il0sWzcsMTAsImdfNCIsMl0sWzMsMTEsImZfNCJdLFsxMSwxMCwidV81Il0sWzEyLDksInYiXSxbMTIsMCwidyJdXQ==
\[\begin{tikzcd}
	E & D & C \\
	{A_1} & {A_2} & {A_3} & {A_4} & {A_5} \\
	{B_1} & {B_2} & {B_3} & {B_4} & {B_5}
	\arrow["{f_1}", from=2-1, to=2-2]
	\arrow["{f_2}", from=2-2, to=2-3]
	\arrow["{f_3}", from=2-3, to=2-4]
	\arrow["{u_1}", from=2-1, to=3-1]
	\arrow["{g_1}"', from=3-1, to=3-2]
	\arrow["{g_2}"', from=3-2, to=3-3]
	\arrow["{g_3}"', from=3-3, to=3-4]
	\arrow["{u_2}", from=2-2, to=3-2]
	\arrow["{u_3}", from=2-3, to=3-3]
	\arrow["{u_4}", from=2-4, to=3-4]
	\arrow["x", from=1-3, to=2-3]
	\arrow["y", from=1-2, to=1-3]
	\arrow["z", from=1-2, to=2-2]
	\arrow["{g_4}"', from=3-4, to=3-5]
	\arrow["{f_4}", from=2-4, to=2-5]
	\arrow["{u_5}", from=2-5, to=3-5]
	\arrow["v", from=1-1, to=1-2]
	\arrow["w", from=1-1, to=2-1]
\end{tikzcd}\]
    Thus \( u_2 z v = g_1 u_1 w \), and \( u_2 \) is monic, so \( zv = f_1 w \).
    Then \( xyv = f_2 zv = f_2 f_1 w = 0 \), and \( yv \) is epic, hence \( x = 0 \).
\end{proof}

\subsection{The snake lemma}
\begin{lemma}
    Consider a diagram in an abelian category
    % https://q.uiver.app/#q=WzAsOCxbMSwwLCJCXzEiXSxbMiwwLCJCXzIiXSxbMywwLCJCXzMiXSxbNCwwLCIwIl0sWzAsMSwiMCJdLFsxLDEsIkNfMSJdLFsyLDEsIkNfMiJdLFszLDEsIkNfMyJdLFswLDFdLFsxLDJdLFsyLDNdLFs0LDVdLFs1LDZdLFs2LDddLFswLDUsInZfMSJdLFsxLDYsInZfMiJdLFsyLDcsInZfMyJdXQ==
\[\begin{tikzcd}
	& {B_1} & {B_2} & {B_3} & 0 \\
	0 & {C_1} & {C_2} & {C_3}
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=2-1, to=2-2]
	\arrow[from=2-2, to=2-3]
	\arrow[from=2-3, to=2-4]
	\arrow["{v_1}", from=1-2, to=2-2]
	\arrow["{v_2}", from=1-3, to=2-3]
	\arrow["{v_3}", from=1-4, to=2-4]
\end{tikzcd}\]
    where the rows are exact and the squares commute.
    Then we obtain an exact sequence
    % https://q.uiver.app/#q=WzAsMTQsWzEsMSwiQl8xIl0sWzIsMSwiQl8yIl0sWzMsMSwiQl8zIl0sWzQsMSwiMCJdLFswLDIsIjAiXSxbMSwyLCJDXzEiXSxbMiwyLCJDXzIiXSxbMywyLCJDXzMiXSxbMSwwLCJcXG9wZXJhdG9ybmFtZXtLZXJ9IHZfMSJdLFsyLDAsIlxcb3BlcmF0b3JuYW1le0tlcn12XzIiXSxbMywwLCJcXG9wZXJhdG9ybmFtZXtLZXJ9dl8zIl0sWzEsMywiXFxvcGVyYXRvcm5hbWV7Q29rZXJ9dl8xIl0sWzIsMywiXFxvcGVyYXRvcm5hbWV7Q29rZXJ9dl8yIl0sWzMsMywiXFxvcGVyYXRvcm5hbWV7Q29rZXJ9IHZfMyJdLFswLDFdLFsxLDJdLFsyLDNdLFs0LDVdLFs1LDZdLFs2LDddLFswLDUsInZfMSJdLFsxLDYsInZfMiJdLFsyLDcsInZfMyJdLFs4LDldLFs5LDEwXSxbMTAsMTEsInMiXSxbMTEsMTJdLFsxMiwxM10sWzgsMF0sWzksMV0sWzEwLDJdLFs1LDExXSxbNiwxMl0sWzcsMTNdXQ==
\[\begin{tikzcd}
	& {\operatorname{Ker} v_1} & {\operatorname{Ker}v_2} & {\operatorname{Ker}v_3} \\
	& {B_1} & {B_2} & {B_3} & 0 \\
    & & \ar[draw=none]{d}[name=X, anchor=center]{} \\
	0 & {C_1} & {C_2} & {C_3} \\
	& {\operatorname{Coker}v_1} & {\operatorname{Coker}v_2} & {\operatorname{Coker} v_3}
	\arrow[from=2-2, to=2-3]
	\arrow[from=2-3, to=2-4]
	\arrow[from=2-4, to=2-5]
	\arrow[from=4-1, to=4-2]
	\arrow[from=4-2, to=4-3]
	\arrow[from=4-3, to=4-4]
	\arrow["{v_1}"{pos=0.7}, from=2-2, to=4-2]
	\arrow["{v_2}"{pos=0.7}, from=2-3, to=4-3]
	\arrow["{v_3}"{pos=0.7}, from=2-4, to=4-4]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=5-2, to=5-3]
	\arrow[from=5-3, to=5-4]
	\arrow[from=1-2, to=2-2]
	\arrow[from=1-3, to=2-3]
	\arrow[from=1-4, to=2-4]
	\arrow[from=4-2, to=5-2]
	\arrow[from=4-3, to=5-3]
	\arrow[from=4-4, to=5-4]
    \arrow[from=1-4, to=5-2, "s", rounded corners,
      to path={ -- ([xshift=2ex]\tikztostart.east)
                |- ([yshift=4ex]X.center) \tikztonodes
                -| ([xshift=-2ex]\tikztotarget.west)
                -- (\tikztotarget)}]
\end{tikzcd}\]
\end{lemma}

\subsection{Complexes in abelian categories}
\begin{definition}
    Let \( \mathcal A \) be an abelian category.
    A \emph{(chain) complex} in \( \mathcal A \) is an infinite sequence of objects and morphisms
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCJcXGNkb3RzIl0sWzEsMCwiQ197bisxfSJdLFsyLDAsIkNfbiJdLFszLDAsIkNfe24tMX0iXSxbNCwwLCJcXGNkb3RzIl0sWzAsMV0sWzEsMiwiZF97bisxfSJdLFsyLDMsImRfbiJdLFszLDRdXQ==
    \[\begin{tikzcd}
        \cdots & {C_{n+1}} & {C_n} & {C_{n-1}} & \cdots
        \arrow[from=1-1, to=1-2]
        \arrow["{d_{n+1}}", from=1-2, to=1-3]
        \arrow["{d_n}", from=1-3, to=1-4]
        \arrow[from=1-4, to=1-5]
    \end{tikzcd}\]
    where the composite of any two consecutive morphisms is zero.
\end{definition}
Note that a complex may be identified with an additive functor \( \mathcal Z \to \mathcal A \), where \( \mathcal Z \) is the additive category with \( \ob \mathcal Z = \mathbb Z \) and
\[ \mathcal Z(n, m) = \begin{cases}
    \mathbb Z & \text{if } m = n \text{ or } m = n - 1 \\
    0 & \text{otherwise}
\end{cases} \]
Thus, complexes on \( \mathcal A \) are the objects of an abelian category \( \textsc{c}\mathcal A = \operatorname{Add}(\mathcal Z, \mathcal A) \), where the morphisms are natural transformations.
\begin{definition}
    Let \( C_\bullet \) be a complex.
    We define
    \begin{enumerate}
        \item \( Z_n(C_\bullet) \rightarrowtail C_n \) to be the kernel of \( d_n \);
        \item \( I_n(C_\bullet) \rightarrowtail C_n \) to be the image of \( d_{n+1} \);
        \item \( Z_n(C_\bullet) \twoheadrightarrow H_n(C_\bullet) \) to be the cokernel of \( I_n(C_\bullet) \rightarrowtail Z_n(C_\bullet) \).
    \end{enumerate}
    We say that \( H_n(C_\bullet) \) is the \emph{\( n \)th homology object} of \( C_\bullet \).
\end{definition}
Note that \( Z_n, I_n, H_n \) are additive functors \( \textsc{c}\mathcal A \to \mathcal A \).
\begin{lemma}
    The construction of \( H_n(C_\bullet) \) is self-dual.
\end{lemma}
\begin{proof}
    Write \( C_n \twoheadrightarrow Q_n(C_\bullet) \) for the cokernel of \( d_{n+1} \).
    Then we have the diagram
    % https://q.uiver.app/#q=WzAsOCxbMCwwLCJDX3tuKzF9Il0sWzIsMCwiQ19uIl0sWzQsMCwiQ197bi0xfSJdLFswLDEsIklfbiJdLFsxLDEsIlpfbiJdLFszLDEsIlFfbiJdLFs0LDEsIklfe24tMX0iXSxbMiwxLCJIX24iXSxbMCwxLCJkX3tuKzF9Il0sWzEsMiwiZF9uIl0sWzAsMywiIiwyLHsic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoiZXBpIn19fV0sWzMsNCwiIiwyLHsic3R5bGUiOnsidGFpbCI6eyJuYW1lIjoibW9ubyJ9fX1dLFs0LDEsIiIsMix7InN0eWxlIjp7InRhaWwiOnsibmFtZSI6Im1vbm8ifX19XSxbMSw1LCIiLDIseyJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJlcGkifX19XSxbNSw2LCIiLDIseyJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJlcGkifX19XSxbNiwyLCIiLDIseyJzdHlsZSI6eyJ0YWlsIjp7Im5hbWUiOiJtb25vIn19fV0sWzQsNywiIiwyLHsic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoiZXBpIn19fV1d
\[\begin{tikzcd}
	{C_{n+1}} && {C_n} && {C_{n-1}} \\
	{I_n} & {Z_n} & {H_n} & {Q_n} & {I_{n-1}}
	\arrow["{d_{n+1}}", from=1-1, to=1-3]
	\arrow["{d_n}", from=1-3, to=1-5]
	\arrow[two heads, from=1-1, to=2-1]
	\arrow[tail, from=2-1, to=2-2]
	\arrow[tail, from=2-2, to=1-3]
	\arrow[two heads, from=1-3, to=2-4]
	\arrow[two heads, from=2-4, to=2-5]
	\arrow[tail, from=2-5, to=1-5]
	\arrow[two heads, from=2-2, to=2-3]
\end{tikzcd}\]
    By definition, \( I_n \to C_n \) is \( \ker (C_n \to Q_n) \).
    As \( Z_n \to C_n \) is a monomorphism, \( I_n \to Z_n \) is \( \ker (Z_n \to C_n \to Q_n) \).
    Hence \( Z_n \to H_n \) is \( \coim(Z_n \to Q_n) \), so we obtain
    % https://q.uiver.app/#q=WzAsOCxbMCwwLCJDX3tuKzF9Il0sWzIsMCwiQ19uIl0sWzQsMCwiQ197bi0xfSJdLFswLDEsIklfbiJdLFsxLDEsIlpfbiJdLFszLDEsIlFfbiJdLFs0LDEsIklfe24tMX0iXSxbMiwxLCJIX24iXSxbMCwxLCJkX3tuKzF9Il0sWzEsMiwiZF9uIl0sWzAsMywiIiwyLHsic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoiZXBpIn19fV0sWzMsNCwiIiwyLHsic3R5bGUiOnsidGFpbCI6eyJuYW1lIjoibW9ubyJ9fX1dLFs0LDEsIiIsMix7InN0eWxlIjp7InRhaWwiOnsibmFtZSI6Im1vbm8ifX19XSxbMSw1LCIiLDIseyJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJlcGkifX19XSxbNSw2LCIiLDIseyJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJlcGkifX19XSxbNiwyLCIiLDIseyJzdHlsZSI6eyJ0YWlsIjp7Im5hbWUiOiJtb25vIn19fV0sWzQsNywiIiwyLHsic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoiZXBpIn19fV0sWzcsNSwiIiwyLHsic3R5bGUiOnsidGFpbCI6eyJuYW1lIjoibW9ubyJ9fX1dXQ==
\[\begin{tikzcd}
	{C_{n+1}} && {C_n} && {C_{n-1}} \\
	{I_n} & {Z_n} & {H_n} & {Q_n} & {I_{n-1}}
	\arrow["{d_{n+1}}", from=1-1, to=1-3]
	\arrow["{d_n}", from=1-3, to=1-5]
	\arrow[two heads, from=1-1, to=2-1]
	\arrow[tail, from=2-1, to=2-2]
	\arrow[tail, from=2-2, to=1-3]
	\arrow[two heads, from=1-3, to=2-4]
	\arrow[two heads, from=2-4, to=2-5]
	\arrow[tail, from=2-5, to=1-5]
	\arrow[two heads, from=2-2, to=2-3]
	\arrow[tail, from=2-3, to=2-4]
\end{tikzcd}\]
    and \( Z_n \twoheadrightarrow H_n \rightarrowtail Q_n \) is the image factorisation of \( Z_n \to Q_n \).
\end{proof}
\begin{theorem}[Mayer--Vietoris sequence]
    Suppose we have a short exact sequence of complexes in \( \mathcal A \).
\[\begin{tikzcd}
	0 & {A_\bullet} & {B_\bullet} & {C_\bullet} & 0
	\arrow[from=1-1, to=1-2]
	\arrow["f_\bullet", from=1-2, to=1-3]
	\arrow["g_\bullet", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    Then there is a long exact sequence of homology objects
    % https://q.uiver.app/#q=WzAsOCxbMCwwLCJcXGNkb3RzIl0sWzEsMCwiSF9uKEFfXFxidWxsZXQpIl0sWzIsMCwiSF9uKEJfXFxidWxsZXQpIl0sWzMsMCwiSF9uKENfXFxidWxsZXQpIl0sWzQsMCwiSF97bi0xfShBX1xcYnVsbGV0KSJdLFs1LDAsIkhfe24tMX0oQl9cXGJ1bGxldCkiXSxbNiwwLCJIX3tuLTF9KENfXFxidWxsZXQpIl0sWzcsMCwiXFxjZG90cyJdLFswLDFdLFsxLDIsIkhfbihmX1xcYnVsbGV0KSJdLFsyLDMsIkhfbihnX1xcYnVsbGV0KSJdLFszLDRdLFs0LDUsIkhfe24tMX0oZl9cXGJ1bGxldCkiXSxbNSw2LCJIX3tuLTF9KGdfXFxidWxsZXQpIl0sWzYsN11d
\[\begin{tikzcd}
	\cdots & {H_n(A_\bullet)} & {H_n(B_\bullet)} & {H_n(C_\bullet)} & {H_{n-1}(A_\bullet)} & {H_{n-1}(B_\bullet)} & {H_{n-1}(C_\bullet)} & \cdots
	\arrow[from=1-1, to=1-2]
	\arrow["{H_n(f_\bullet)}", from=1-2, to=1-3]
	\arrow["{H_n(g_\bullet)}", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow["{H_{n-1}(f_\bullet)}", from=1-5, to=1-6]
	\arrow["{H_{n-1}(g_\bullet)}", from=1-6, to=1-7]
	\arrow[from=1-7, to=1-8]
\end{tikzcd}\]
\end{theorem}
\begin{proof}
    First, we apply the snake lemma to
    % https://q.uiver.app/#q=WzAsMTAsWzAsMCwiMCJdLFsyLDAsIkJfe24rMX0iXSxbMywwLCJDX3tuKzF9Il0sWzQsMCwiMCJdLFswLDEsIjAiXSxbMSwxLCJBX24iXSxbMiwxLCJCX24iXSxbMywxLCJDX24iXSxbNCwxLCIwIl0sWzEsMCwiQV97bisxfSJdLFsxLDIsImdfe24rMX0iXSxbMiwzXSxbNCw1XSxbNSw2LCJmX24iLDJdLFs2LDcsImdfbiIsMl0sWzcsOF0sWzEsNl0sWzIsN10sWzAsOV0sWzksMSwiZl97bisxfSJdLFs5LDVdXQ==
\[\begin{tikzcd}
	0 & {A_{n+1}} & {B_{n+1}} & {C_{n+1}} & 0 \\
	0 & {A_n} & {B_n} & {C_n} & 0
	\arrow["{g_{n+1}}", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=2-1, to=2-2]
	\arrow["{f_n}"', from=2-2, to=2-3]
	\arrow["{g_n}"', from=2-3, to=2-4]
	\arrow[from=2-4, to=2-5]
	\arrow[from=1-3, to=2-3]
	\arrow[from=1-4, to=2-4]
	\arrow[from=1-1, to=1-2]
	\arrow["{f_{n+1}}", from=1-2, to=1-3]
	\arrow[from=1-2, to=2-2]
\end{tikzcd}\]
    to obtain exact sequences
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCIwIl0sWzEsMCwiWl97bisxfShBX1xcYnVsbGV0KSJdLFsyLDAsIlpfe24rMX0oQl9cXGJ1bGxldCkiXSxbMywwLCJaX3tuKzF9KENfXFxidWxsZXQpIl0sWzAsMV0sWzEsMl0sWzIsM11d
\[\begin{tikzcd}
	0 & {Z_{n+1}(A_\bullet)} & {Z_{n+1}(B_\bullet)} & {Z_{n+1}(C_\bullet)}
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
\end{tikzcd}\]
    and
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCJRX24oQV9cXGJ1bGxldCkiXSxbMSwwLCJRX24oQl9cXGJ1bGxldCkiXSxbMiwwLCJRX24oQ19cXGJ1bGxldCkiXSxbMywwLCIwIl0sWzAsMV0sWzEsMl0sWzIsM11d
\[\begin{tikzcd}
	{Q_n(A_\bullet)} & {Q_n(B_\bullet)} & {Q_n(C_\bullet)} & 0
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
\end{tikzcd}\]
    Thus \( Z_n \) is a left exact functor and \( Q_n \) is right exact.
    We now apply the snake lemma again to the diagram
    % https://q.uiver.app/#q=WzAsOCxbMSwwLCJRX3tuKzF9KEFfXFxidWxsZXQpIl0sWzIsMCwiUV97bisxfShCX1xcYnVsbGV0KSJdLFszLDAsIlFfe24rMX0oQ19cXGJ1bGxldCkiXSxbNCwwLCIwIl0sWzAsMSwiMCJdLFsxLDEsIlpfbihBX1xcYnVsbGV0KSJdLFsyLDEsIlpfbihCX1xcYnVsbGV0KSJdLFszLDEsIlpfbihDX1xcYnVsbGV0KSJdLFswLDFdLFsxLDJdLFsyLDNdLFs0LDVdLFs1LDZdLFs2LDddLFswLDVdLFsxLDZdLFsyLDddXQ==
\[\begin{tikzcd}
	& {Q_{n+1}(A_\bullet)} & {Q_{n+1}(B_\bullet)} & {Q_{n+1}(C_\bullet)} & 0 \\
	0 & {Z_n(A_\bullet)} & {Z_n(B_\bullet)} & {Z_n(C_\bullet)}
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=2-1, to=2-2]
	\arrow[from=2-2, to=2-3]
	\arrow[from=2-3, to=2-4]
	\arrow[from=1-2, to=2-2]
	\arrow[from=1-3, to=2-3]
	\arrow[from=1-4, to=2-4]
\end{tikzcd}\]
    Here, the cokernel of \( Q_{n+1} \to Z_n \) coincides with that of \( I_n \to Z_n \) as \( Q_{n+1} \to I_n \) is epic.
    Their kernels coincide with \( H_{n+1} \to Q_{n+1} \) as homology is self-dual.
    Hence we obtain
    % https://q.uiver.app/#q=WzAsNixbMCwwLCJIX3tuKzF9KEFfXFxidWxsZXQpIl0sWzEsMCwiSF97bisxfShCX1xcYnVsbGV0KSJdLFsyLDAsIkhfe24rMX0oQ19cXGJ1bGxldCkiXSxbMywwLCJIX24oQV9cXGJ1bGxldCkiXSxbNCwwLCJIX24oQl9cXGJ1bGxldCkiXSxbNSwwLCJIX24oQ19cXGJ1bGxldCkiXSxbMCwxXSxbMSwyXSxbMiwzXSxbMyw0XSxbNCw1XV0=
\[\begin{tikzcd}
	{H_{n+1}(A_\bullet)} & {H_{n+1}(B_\bullet)} & {H_{n+1}(C_\bullet)} & {H_n(A_\bullet)} & {H_n(B_\bullet)} & {H_n(C_\bullet)}
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=1-5, to=1-6]
\end{tikzcd}\]
    as required.
\end{proof}
Note that \( Z_n : \textsc{c}\mathcal A \to \mathcal A \) is the right adjoint to the functor \( A \mapsto A[n] \), where \( A[n] \) is the complex that has \( A \) in dimension \( n \) and \( 0 \) everywhere else; this gives another proof that \( Z \) is left exact.
Dually, \( Q_n \) is the left adjoint to this functor.
\begin{definition}
    Let \( f_\bullet, g_\bullet : C_\bullet \rightrightarrows D_\bullet \) be two morphisms of \( \textsc{c}\mathcal A \).
    A \emph{homotopy} from \( f_\bullet \) to \( g_\bullet \) is a sequence of morphisms \( h_n : C_n \to D_{n+1} \) such that
    \[ g_n - f_n = d_{n+1} h_n + h_{n-1} d_n \]
    for all \( n \).
    We say that \( f_\bullet, g_\bullet \) are \emph{homotopic} and write \( f_\bullet \simeq g_\bullet \) if there exists such a sequence \( h_\bullet \).
\end{definition}
Homotopy is an equivalence relation on morphisms of \( \textsc{c}\mathcal A \).
It is a congruence, as it is compatible with composition on both sides; indeed, if \( k_\bullet : D_\bullet \to E_\bullet \), and \( h_\bullet : f_\bullet \simeq g_\bullet \), then the morphisms \( k_{n+1} h_n \) form a homotopy \( k_\bullet f_\bullet \to k_\bullet g_\bullet \), and similarly for the other side.
We write \( \textsc{h}\mathcal A \) for the quotient of \( \textsc{c}\mathcal A \) by the homotopy congruence.
Also, homotopy is compatible with addition, by adding the relevant homotopies, so the quotient category inherits an additive structure, and the quotient \( \textsc{c}\mathcal A \to \textsc{h}\mathcal A \) is an additive functor.
In particular, \( \textsc{h}\mathcal A \) has finite biproducts, although it is not an abelian category.
\begin{lemma}
    If \( f_\bullet \simeq g_\bullet : C_\bullet \rightrightarrows D_\bullet \), then \( H_n(f_\bullet) = H_n(g_\bullet) \) for all \( n \).
\end{lemma}
Thus, the \( H_n \) can be regarded as additive functors \( \textsc{h}\mathcal A \to \mathcal A \).
\begin{proof}
    Let \( h_\bullet \) be a homotopy from \( f_\bullet \) to \( g_\bullet \), so \( g_n - f_n = d_{n+1} h_n + h_{n-1} d_n \).
    Then \( Z_n(g_\bullet) - Z_n(f_\bullet) \) is the restriction of \( d_{n+1} h_n \) to \( Z_n(C_\bullet) \), since \( h_{n-1} d_n \) is zero on this subobject.
    Similarly, \( H_n(g_\bullet) - H_n(f_\bullet) \) is zero, as \( d_{n+1} h_n \) vanishes when factoring through the quotient.
\end{proof}

\subsection{Projective resolutions}
\begin{definition}
    A category \( \mathcal C \) has \emph{enough projectives} if for every object \( A \), there exists an epimorphism \( P \twoheadrightarrow A \) where \( P \) is projective.
\end{definition}
Note that this holds in \( \mathbf{AbGp} \) and \( \mathbf{Mod}_R \) for any commutative ring \( R \), because free modules are projective, and every module can be written as a quotient of a free module.
\begin{definition}
    Let \( \mathcal A \) be an abelian category and let \( A \) be an object of \( \mathcal A \).
    A \emph{projective resolution} of \( A \) is a complex \( P_\bullet \) where the objects \( P_n \) are projective, \( P_n = 0 \) for all \( n < 0 \), and
    \[ H_n(P_\bullet) = \begin{cases}
        A & \text{if } n = 0 \\
        0 & \text{otherwise}
    \end{cases} \]
    Equivalently, a projective resolution is an exact sequence
    % https://q.uiver.app/#q=WzAsNixbMCwwLCJcXGNkb3RzIl0sWzEsMCwiUF8yIl0sWzIsMCwiUF8xIl0sWzMsMCwiUF8wIl0sWzQsMCwiQSJdLFs1LDAsIjAiXSxbMCwxXSxbMSwyXSxbMiwzXSxbMyw0XSxbNCw1XV0=
\[\begin{tikzcd}
	\cdots & {P_2} & {P_1} & {P_0} & A & 0
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=1-5, to=1-6]
\end{tikzcd}\]
    where the \( P_i \) are projective.
\end{definition}
\begin{lemma}
    Let \( \mathcal A \) be an abelian category that has enough projectives.
    Then every object of \( \mathcal A \) has a projective resolution.
\end{lemma}
\begin{proof}
    Given an object \( A \), choose some projective object \( P_0 \) with an epimorphism \( P_0 \twoheadrightarrow A \).
    Let \( K_0 \rightarrowtail P_0 \) be its kernel, and choose \( P_1 \) to be a projective object with an epimorphism \( P_1 \twoheadrightarrow K_0 \), then continue by induction.
\end{proof}
\begin{lemma}
    Suppose \( P_\bullet, Q_\bullet \) are projective resolutions of objects \( A, B \).
    Then for any \( f : A \to B \), there is a morphism of complexes \( f_\bullet : P_\bullet \to Q_\bullet \) with \( H_\bullet(f_\bullet) = f \).
    Moreover, any two such morphisms \( P_\bullet \to Q_\bullet \) are homotopic.
\end{lemma}
\begin{proof}
    Consider the diagram
    % https://q.uiver.app/#q=WzAsMTIsWzUsMCwiQSJdLFs1LDEsIkIiXSxbNCwwLCJQXzAiXSxbNCwxLCJRXzAiXSxbMCwwLCJQXzIiXSxbMSwwLCJLXzEiXSxbMiwwLCJQXzEiXSxbMywwLCJLXzAiXSxbMCwxLCJRXzIiXSxbMSwxLCJMXzEiXSxbMiwxLCJRXzEiXSxbMywxLCJMXzAiXSxbMCwxLCJmIl0sWzMsMV0sWzIsMF0sWzQsNV0sWzUsNl0sWzYsN10sWzcsMl0sWzgsOV0sWzksMTBdLFsxMCwxMV0sWzExLDNdXQ==
\[\begin{tikzcd}
	{P_2} & {K_1} & {P_1} & {K_0} & {P_0} & A \\
	{Q_2} & {L_1} & {Q_1} & {L_0} & {Q_0} & B
	\arrow["f", from=1-6, to=2-6]
	\arrow[from=2-5, to=2-6]
	\arrow[from=1-5, to=1-6]
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=2-1, to=2-2]
	\arrow[from=2-2, to=2-3]
	\arrow[from=2-3, to=2-4]
	\arrow[from=2-4, to=2-5]
\end{tikzcd}\]
    By projectivity of \( P_0 \), we obtain \( f_0 \) completing the right-hand square.
    % https://q.uiver.app/#q=WzAsMTIsWzUsMCwiQSJdLFs1LDEsIkIiXSxbNCwwLCJQXzAiXSxbNCwxLCJRXzAiXSxbMCwwLCJQXzIiXSxbMSwwLCJLXzEiXSxbMiwwLCJQXzEiXSxbMywwLCJLXzAiXSxbMCwxLCJRXzIiXSxbMSwxLCJMXzEiXSxbMiwxLCJRXzEiXSxbMywxLCJMXzAiXSxbMCwxLCJmIl0sWzMsMV0sWzIsMF0sWzQsNV0sWzUsNl0sWzYsN10sWzcsMl0sWzgsOV0sWzksMTBdLFsxMCwxMV0sWzExLDNdLFsyLDMsImZfMCJdXQ==
\[\begin{tikzcd}
	{P_2} & {K_1} & {P_1} & {K_0} & {P_0} & A \\
	{Q_2} & {L_1} & {Q_1} & {L_0} & {Q_0} & B
	\arrow["f", from=1-6, to=2-6]
	\arrow[from=2-5, to=2-6]
	\arrow[from=1-5, to=1-6]
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=2-1, to=2-2]
	\arrow[from=2-2, to=2-3]
	\arrow[from=2-3, to=2-4]
	\arrow[from=2-4, to=2-5]
	\arrow["{f_0}", from=1-5, to=2-5]
\end{tikzcd}\]
    The morphism \( P_1 \to P_0 \to A \) is zero by exactness, so \( P_1 \to P_0 \to Q_0 \to B \) is also zero.
    Thus \( P_1 \to Q_0 \) factors through the kernel \( L_0 \to Q_0 \).
    We then obtain \( f_1 \) by projectivity.
    % https://q.uiver.app/#q=WzAsMTIsWzUsMCwiQSJdLFs1LDEsIkIiXSxbNCwwLCJQXzAiXSxbNCwxLCJRXzAiXSxbMCwwLCJQXzIiXSxbMSwwLCJLXzEiXSxbMiwwLCJQXzEiXSxbMywwLCJLXzAiXSxbMCwxLCJRXzIiXSxbMSwxLCJMXzEiXSxbMiwxLCJRXzEiXSxbMywxLCJMXzAiXSxbMCwxLCJmIl0sWzMsMV0sWzIsMF0sWzQsNV0sWzUsNl0sWzYsN10sWzcsMl0sWzgsOV0sWzksMTBdLFsxMCwxMV0sWzExLDNdLFsyLDMsImZfMCJdLFs2LDExXSxbNiwxMCwiZl8xIiwyXV0=
\[\begin{tikzcd}
	{P_2} & {K_1} & {P_1} & {K_0} & {P_0} & A \\
	{Q_2} & {L_1} & {Q_1} & {L_0} & {Q_0} & B
	\arrow["f", from=1-6, to=2-6]
	\arrow[from=2-5, to=2-6]
	\arrow[from=1-5, to=1-6]
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=2-1, to=2-2]
	\arrow[from=2-2, to=2-3]
	\arrow[from=2-3, to=2-4]
	\arrow[from=2-4, to=2-5]
	\arrow["{f_0}", from=1-5, to=2-5]
	\arrow[from=1-3, to=2-4]
	\arrow["{f_1}"', from=1-3, to=2-3]
\end{tikzcd}\]
    Continue by induction.

    Now suppose we have another morphism of chains \( g_\bullet \) with \( H_0(g_\bullet) = f \).
    Then \( g_0 - f_0 \) factors through \( L_0 \to Q_0 \) as they have the same composite with \( Q_0 \to B \).
    Thus we obtain
    % https://q.uiver.app/#q=WzAsMTIsWzUsMCwiQSJdLFs1LDEsIkIiXSxbNCwwLCJQXzAiXSxbNCwxLCJRXzAiXSxbMCwwLCJQXzIiXSxbMSwwLCJLXzEiXSxbMiwwLCJQXzEiXSxbMywwLCJLXzAiXSxbMCwxLCJRXzIiXSxbMSwxLCJMXzEiXSxbMiwxLCJRXzEiXSxbMywxLCJMXzAiXSxbMCwxLCJmIl0sWzMsMV0sWzIsMF0sWzQsNV0sWzUsNl0sWzYsN10sWzcsMl0sWzgsOV0sWzksMTBdLFsxMCwxMV0sWzExLDNdLFsyLDNdLFs2LDExXSxbNiwxMF0sWzIsMTAsImhfMCIsMCx7ImxhYmVsX3Bvc2l0aW9uIjozMH1dXQ==
\[\begin{tikzcd}
	{P_2} & {K_1} & {P_1} & {K_0} & {P_0} & A \\
	{Q_2} & {L_1} & {Q_1} & {L_0} & {Q_0} & B
	\arrow["f", from=1-6, to=2-6]
	\arrow[from=2-5, to=2-6]
	\arrow[from=1-5, to=1-6]
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=2-1, to=2-2]
	\arrow[from=2-2, to=2-3]
	\arrow[from=2-3, to=2-4]
	\arrow[from=2-4, to=2-5]
	\arrow[from=1-5, to=2-5]
	\arrow[from=1-3, to=2-4]
	\arrow[from=1-3, to=2-3]
	\arrow["{h_0}"{pos=0.3}, from=1-5, to=2-3]
\end{tikzcd}\]
    where \( d_1' h_0 = g_0 - f_0 \).
    Then
    \[ d_1'(g_1 - f_1 - h_0 d_1) = d_1' g_1 - d_1' f_1 - d_1' h_0 d_1 = g_0 d_1 - f_0 d_1 - d_1' h_0 d_1 = 0 \]
    Hence \( g_1 - f_1 - h_0 d_1 \) factors through \( L_1 \to Q_1 \), so we obtain \( h_1 \) as follows.
    % https://q.uiver.app/#q=WzAsMTIsWzUsMCwiQSJdLFs1LDEsIkIiXSxbNCwwLCJQXzAiXSxbNCwxLCJRXzAiXSxbMCwwLCJQXzIiXSxbMSwwLCJLXzEiXSxbMiwwLCJQXzEiXSxbMywwLCJLXzAiXSxbMCwxLCJRXzIiXSxbMSwxLCJMXzEiXSxbMiwxLCJRXzEiXSxbMywxLCJMXzAiXSxbMCwxLCJmIl0sWzMsMV0sWzIsMF0sWzQsNV0sWzUsNl0sWzYsN10sWzcsMl0sWzgsOV0sWzksMTBdLFsxMCwxMV0sWzExLDNdLFsyLDNdLFs2LDExXSxbNiwxMF0sWzIsMTAsImhfMCIsMCx7ImxhYmVsX3Bvc2l0aW9uIjozMH1dLFs2LDgsImhfMSIsMCx7ImxhYmVsX3Bvc2l0aW9uIjozMH1dLFs0LDldXQ==
\[\begin{tikzcd}
	{P_2} & {K_1} & {P_1} & {K_0} & {P_0} & A \\
	{Q_2} & {L_1} & {Q_1} & {L_0} & {Q_0} & B
	\arrow["f", from=1-6, to=2-6]
	\arrow[from=2-5, to=2-6]
	\arrow[from=1-5, to=1-6]
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=2-1, to=2-2]
	\arrow[from=2-2, to=2-3]
	\arrow[from=2-3, to=2-4]
	\arrow[from=2-4, to=2-5]
	\arrow[from=1-5, to=2-5]
	\arrow[from=1-3, to=2-4]
	\arrow[from=1-3, to=2-3]
	\arrow["{h_0}"{pos=0.3}, from=1-5, to=2-3]
	\arrow["{h_1}"{pos=0.3}, from=1-3, to=2-1]
	\arrow[from=1-1, to=2-2]
\end{tikzcd}\]
    Then \( d_2' h_1 + h_0 d_1 = g_1 - f_1 \) as required.
    Continue similarly by induction to construct all components of the homotopy.
\end{proof}
Thus construction of projective resolution is a functor.
Note that in this proof we never made use of projectivity of \( Q_\bullet \).
In particular, this shows that the construction of projective resolutions is left adjoint to \( H_0 : \mathcal C \to \mathcal A \) where \( \mathcal C \subseteq \textsc{h}\mathcal A \) is the full subcategory on complexes \( C_\bullet \) for which \( H_n(C_\bullet) = 0 \) for all \( n > 0 \).

\subsection{Derived functors}
Let \( F : \mathcal A \to \mathcal B \) be an additive functor between abelian categories.
Then \( F \) extends to a functor \( \textsc{c}F : \textsc{c}\mathcal A \to \textsc{c}\mathcal B \) which respects homotopy.
Hence \( F \) induces a functor \( \textsc{h}F : \textsc{h}\mathcal A \to \textsc{h}\mathcal B \).
\begin{definition}
    Let \( F : \mathcal A \to \mathcal B \) be an additive functor between abelian categories, and suppose \( \mathcal A \) has enough projectives.
    Then the \emph{left derived functor} \( L^n F \) of \( F \) is the composite
    % https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhjYWwgQSJdLFsxLDAsIlxcdGV4dHNje2h9XFxtYXRoY2FsIEEiXSxbMiwwLCJcXHRleHRzY3tofVxcbWF0aGNhbCBCIl0sWzMsMCwiXFxtYXRoY2FsIEIiXSxbMCwxLCJcXG1hdGhybXtQUn0iXSxbMSwyLCJcXHRleHRzY3tofUYiXSxbMiwzLCJIX24iXV0=
\[\begin{tikzcd}
	{\mathcal A} & {\textsc{h}\mathcal A} & {\textsc{h}\mathcal B} & {\mathcal B}
	\arrow["{\mathrm{PR}}", from=1-1, to=1-2]
	\arrow["{\textsc{h}F}", from=1-2, to=1-3]
	\arrow["{H_n}", from=1-3, to=1-4]
\end{tikzcd}\]
    for any \( n \geq 0 \), where \( \mathrm{PR} \) is the projective resolution functor.
\end{definition}
Note that if \( F \) is exact, we have \( L^0 F \cong F \) and \( L^n F = 0 \) for \( n > 0 \).
More generally, if \( F \) is right exact, then it preserves exactness of
% https://q.uiver.app/#q=WzAsNCxbMCwwLCJQXzEiXSxbMSwwLCJQXzAiXSxbMiwwLCJBIl0sWzMsMCwiMCJdLFswLDFdLFsxLDJdLFsyLDNdXQ==
\[\begin{tikzcd}
	{P_1} & {P_0} & A & 0
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
\end{tikzcd}\]
for any projective resolution \( P_\bullet \) of \( A \).
In particular, \( L^0 F \cong F \) in this case.
\begin{lemma}
    Let
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiQSJdLFsyLDAsIkIiXSxbMywwLCJDIl0sWzQsMCwiMCJdLFswLDFdLFsxLDIsImYiXSxbMiwzLCJnIl0sWzMsNF1d
\[\begin{tikzcd}
	0 & A & B & C & 0
	\arrow[from=1-1, to=1-2]
	\arrow["f", from=1-2, to=1-3]
	\arrow["g", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    be a short exact sequence in an abelian category \( \mathcal A \) with enough projectives.
    Then we can choose projective resolutions \( P_\bullet, Q_\bullet, R_\bullet \) of \( A, B, C \) and morphisms \( f_\bullet, g_\bullet \) extending \( f, g \) making the sequence
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiUF9cXGJ1bGxldCJdLFsyLDAsIlFfXFxidWxsZXQiXSxbMywwLCJSX1xcYnVsbGV0Il0sWzQsMCwiMCJdLFswLDFdLFsxLDIsImZfXFxidWxsZXQiXSxbMiwzLCJnX1xcYnVsbGV0Il0sWzMsNF1d
\[\begin{tikzcd}
	0 & {P_\bullet} & {Q_\bullet} & {R_\bullet} & 0
	\arrow[from=1-1, to=1-2]
	\arrow["{f_\bullet}", from=1-2, to=1-3]
	\arrow["{g_\bullet}", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    exact.
    Moreover, the exactness of this sequence is preserved by arbitrary additive functors.
\end{lemma}
\begin{proof}
    We choose \( P_\bullet, R_\bullet \) arbitrarily, and take \( Q_n = P_n \oplus R_n \); this is projective as the coproduct of projective objects is projective.
    Consider the diagram
    % https://q.uiver.app/#q=WzAsMTIsWzQsMCwiQSJdLFs0LDEsIkIiXSxbNCwyLCJDIl0sWzMsMCwiUF8wIl0sWzIsMCwiS18wIl0sWzEsMCwiUF8xIl0sWzAsMCwiXFxjZG90cyJdLFswLDIsIlxcY2RvdHMiXSxbMSwyLCJSXzEiXSxbMiwyLCJNXzAiXSxbMywyLCJSXzAiXSxbMywxLCJQXzAgXFxvcGx1cyBSXzAiXSxbMCwxLCJmIl0sWzEsMiwiZyJdLFszLDAsImVfMSJdLFs0LDNdLFs1LDRdLFs2LDVdLFs3LDhdLFs4LDldLFs5LDEwXSxbMTAsMiwiZV8zIl0sWzMsMTEsIlxcYmVnaW57cG1hdHJpeH0xXFxcXDBcXGVuZHtwbWF0cml4fSIsMl0sWzExLDEwLCJcXGJlZ2lue3BtYXRyaXh9MCYxXFxlbmR7cG1hdHJpeH0iLDJdXQ==
\[\begin{tikzcd}[ampersand replacement=\&]
	\cdots \& {P_1} \& {K_0} \& {P_0} \& A \\
	\&\&\& {P_0 \oplus R_0} \& B \\
	\cdots \& {R_1} \& {M_0} \& {R_0} \& C
	\arrow["f", from=1-5, to=2-5]
	\arrow["g", from=2-5, to=3-5]
	\arrow["{e_1}", from=1-4, to=1-5]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-1, to=1-2]
	\arrow[from=3-1, to=3-2]
	\arrow[from=3-2, to=3-3]
	\arrow[from=3-3, to=3-4]
	\arrow["{e_3}", from=3-4, to=3-5]
	\arrow["{\begin{pmatrix}1\\0\end{pmatrix}}"', from=1-4, to=2-4]
	\arrow["{\begin{pmatrix}0&1\end{pmatrix}}"', from=2-4, to=3-4]
\end{tikzcd}\]
    By projectivity of \( R_0 \), we obtain \( h : R_0 \to B \), and so we define \( e_2 = \begin{pmatrix} f e_1 & h \end{pmatrix} \).
    % https://q.uiver.app/#q=WzAsMTIsWzQsMCwiQSJdLFs0LDEsIkIiXSxbNCwyLCJDIl0sWzMsMCwiUF8wIl0sWzIsMCwiS18wIl0sWzEsMCwiUF8xIl0sWzAsMCwiXFxjZG90cyJdLFswLDIsIlxcY2RvdHMiXSxbMSwyLCJSXzEiXSxbMiwyLCJNXzAiXSxbMywyLCJSXzAiXSxbMywxLCJQXzAgXFxvcGx1cyBSXzAiXSxbMCwxLCJmIl0sWzEsMiwiZyJdLFszLDAsImVfMSJdLFs0LDNdLFs1LDRdLFs2LDVdLFs3LDhdLFs4LDldLFs5LDEwXSxbMTAsMiwiZV8zIl0sWzMsMTFdLFsxMSwxMF0sWzEwLDEsImgiLDAseyJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbMTEsMSwiZV8yIl1d
\[\begin{tikzcd}
	\cdots & {P_1} & {K_0} & {P_0} & A \\
	&&& {P_0 \oplus R_0} & B \\
	\cdots & {R_1} & {M_0} & {R_0} & C
	\arrow["f", from=1-5, to=2-5]
	\arrow["g", from=2-5, to=3-5]
	\arrow["{e_1}", from=1-4, to=1-5]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-1, to=1-2]
	\arrow[from=3-1, to=3-2]
	\arrow[from=3-2, to=3-3]
	\arrow[from=3-3, to=3-4]
	\arrow["{e_3}", from=3-4, to=3-5]
	\arrow[from=1-4, to=2-4]
	\arrow[from=2-4, to=3-4]
	\arrow["h", dashed, from=3-4, to=2-5]
	\arrow["{e_2}", from=2-4, to=2-5]
\end{tikzcd}\]
    This makes both right-hand squares commute:
    \[ e_2 \begin{pmatrix} 1 \\ 0 \end{pmatrix} = f e_1;\quad g e_2 = \begin{pmatrix} gfe & gh \end{pmatrix} = \begin{pmatrix} 0 & e_3 \end{pmatrix} \]
    To show \( e_2 \) is epic, suppose we have a morphism \( k : B \to D \) such that \( k e_2 = 0 \).
    % https://q.uiver.app/#q=WzAsMTMsWzQsMCwiQSJdLFs0LDEsIkIiXSxbNCwyLCJDIl0sWzMsMCwiUF8wIl0sWzIsMCwiS18wIl0sWzEsMCwiUF8xIl0sWzAsMCwiXFxjZG90cyJdLFswLDIsIlxcY2RvdHMiXSxbMSwyLCJSXzEiXSxbMiwyLCJNXzAiXSxbMywyLCJSXzAiXSxbMywxLCJQXzAgXFxvcGx1cyBSXzAiXSxbNSwxLCJEIl0sWzAsMSwiZiJdLFsxLDIsImciXSxbMywwLCJlXzEiXSxbNCwzXSxbNSw0XSxbNiw1XSxbNyw4XSxbOCw5XSxbOSwxMF0sWzEwLDIsImVfMyJdLFszLDExXSxbMTEsMTBdLFsxMSwxLCJlXzIiXSxbMSwxMiwiayJdXQ==
\[\begin{tikzcd}
	\cdots & {P_1} & {K_0} & {P_0} & A \\
	&&& {P_0 \oplus R_0} & B & D \\
	\cdots & {R_1} & {M_0} & {R_0} & C
	\arrow["f", from=1-5, to=2-5]
	\arrow["g", from=2-5, to=3-5]
	\arrow["{e_1}", from=1-4, to=1-5]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-1, to=1-2]
	\arrow[from=3-1, to=3-2]
	\arrow[from=3-2, to=3-3]
	\arrow[from=3-3, to=3-4]
	\arrow["{e_3}", from=3-4, to=3-5]
	\arrow[from=1-4, to=2-4]
	\arrow[from=2-4, to=3-4]
	\arrow["{e_2}", from=2-4, to=2-5]
	\arrow["k", from=2-5, to=2-6]
\end{tikzcd}\]
    Then \( kfe_1 = 0 \), so \( k \) factors as \( \ell g \) for some \( \ell \).
    % https://q.uiver.app/#q=WzAsMTMsWzQsMCwiQSJdLFs0LDEsIkIiXSxbNCwyLCJDIl0sWzMsMCwiUF8wIl0sWzIsMCwiS18wIl0sWzEsMCwiUF8xIl0sWzAsMCwiXFxjZG90cyJdLFswLDIsIlxcY2RvdHMiXSxbMSwyLCJSXzEiXSxbMiwyLCJNXzAiXSxbMywyLCJSXzAiXSxbMywxLCJQXzAgXFxvcGx1cyBSXzAiXSxbNSwxLCJEIl0sWzAsMSwiZiJdLFsxLDIsImciXSxbMywwLCJlXzEiXSxbNCwzXSxbNSw0XSxbNiw1XSxbNyw4XSxbOCw5XSxbOSwxMF0sWzEwLDIsImVfMyJdLFszLDExXSxbMTEsMTBdLFsxMSwxLCJlXzIiXSxbMSwxMiwiayJdLFsyLDEyLCJcXGVsbCIsMl1d
\[\begin{tikzcd}
	\cdots & {P_1} & {K_0} & {P_0} & A \\
	&&& {P_0 \oplus R_0} & B & D \\
	\cdots & {R_1} & {M_0} & {R_0} & C
	\arrow["f", from=1-5, to=2-5]
	\arrow["g", from=2-5, to=3-5]
	\arrow["{e_1}", from=1-4, to=1-5]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-1, to=1-2]
	\arrow[from=3-1, to=3-2]
	\arrow[from=3-2, to=3-3]
	\arrow[from=3-3, to=3-4]
	\arrow["{e_3}", from=3-4, to=3-5]
	\arrow[from=1-4, to=2-4]
	\arrow[from=2-4, to=3-4]
	\arrow["{e_2}", from=2-4, to=2-5]
	\arrow["k", from=2-5, to=2-6]
	\arrow["\ell"', from=3-5, to=2-6]
\end{tikzcd}\]
    Now \( \ell e_3 \begin{pmatrix} 0 & 1 \end{pmatrix} = \ell g e_2 = k e_2 = 0 \), so \( \ell = 0 \) as \( e_3 \) and \( \begin{pmatrix} 0 & 1 \end{pmatrix} \) are pseudoepimorphisms.
    Thus \( k = 0 \).
    Forming the kernel, we obtain
    % https://q.uiver.app/#q=WzAsMTMsWzQsMCwiQSJdLFs0LDEsIkIiXSxbNCwyLCJDIl0sWzMsMCwiUF8wIl0sWzIsMCwiS18wIl0sWzEsMCwiUF8xIl0sWzAsMCwiXFxjZG90cyJdLFswLDIsIlxcY2RvdHMiXSxbMSwyLCJSXzEiXSxbMiwyLCJNXzAiXSxbMywyLCJSXzAiXSxbMywxLCJQXzAgXFxvcGx1cyBSXzAiXSxbMiwxLCJMXzAiXSxbMCwxLCJmIl0sWzEsMiwiZyJdLFszLDAsImVfMSJdLFs0LDNdLFs1LDRdLFs2LDVdLFs3LDhdLFs4LDldLFs5LDEwXSxbMTAsMiwiZV8zIl0sWzMsMTFdLFsxMSwxMF0sWzExLDEsImVfMiJdLFs0LDEyXSxbMTIsOV0sWzEyLDExXV0=
\[\begin{tikzcd}
	\cdots & {P_1} & {K_0} & {P_0} & A \\
	&& {L_0} & {P_0 \oplus R_0} & B \\
	\cdots & {R_1} & {M_0} & {R_0} & C
	\arrow["f", from=1-5, to=2-5]
	\arrow["g", from=2-5, to=3-5]
	\arrow["{e_1}", from=1-4, to=1-5]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-1, to=1-2]
	\arrow[from=3-1, to=3-2]
	\arrow[from=3-2, to=3-3]
	\arrow[from=3-3, to=3-4]
	\arrow["{e_3}", from=3-4, to=3-5]
	\arrow[from=1-4, to=2-4]
	\arrow[from=2-4, to=3-4]
	\arrow["{e_2}", from=2-4, to=2-5]
	\arrow[from=1-3, to=2-3]
	\arrow[from=2-3, to=3-3]
	\arrow[from=2-3, to=2-4]
\end{tikzcd}\]
    Applying the snake lemma to the diagram
    % https://q.uiver.app/#q=WzAsMTEsWzIsMSwiQSJdLFsyLDIsIkIiXSxbMiwzLCJDIl0sWzEsMSwiUF8wIl0sWzAsMSwiS18wIl0sWzAsMywiTV8wIl0sWzEsMywiUl8wIl0sWzEsMiwiUF8wIFxcb3BsdXMgUl8wIl0sWzAsMiwiTF8wIl0sWzEsNCwiMCJdLFsyLDAsIjAiXSxbMCwxLCJmIl0sWzEsMiwiZyJdLFszLDAsImVfMSJdLFs0LDNdLFs1LDZdLFs2LDIsImVfMyJdLFszLDddLFs3LDZdLFs3LDEsImVfMiJdLFs0LDhdLFs4LDVdLFs4LDddLFs2LDldLFsxMCwwXV0=
\[\begin{tikzcd}
	&& 0 \\
	{K_0} & {P_0} & A \\
	{L_0} & {P_0 \oplus R_0} & B \\
	{M_0} & {R_0} & C \\
	& 0
	\arrow["f", from=2-3, to=3-3]
	\arrow["g", from=3-3, to=4-3]
	\arrow["{e_1}", from=2-2, to=2-3]
	\arrow[from=2-1, to=2-2]
	\arrow[from=4-1, to=4-2]
	\arrow["{e_3}", from=4-2, to=4-3]
	\arrow[from=2-2, to=3-2]
	\arrow[from=3-2, to=4-2]
	\arrow["{e_2}", from=3-2, to=3-3]
	\arrow[from=2-1, to=3-1]
	\arrow[from=3-1, to=4-1]
	\arrow[from=3-1, to=3-2]
	\arrow[from=4-2, to=5-2]
	\arrow[from=1-3, to=2-3]
\end{tikzcd}\]
    the left-hand column extends to a short exact sequence.
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiS18wIl0sWzIsMCwiTF8wIl0sWzMsMCwiTV8wIl0sWzQsMCwiMCJdLFswLDFdLFsxLDJdLFsyLDNdLFszLDRdXQ==
\[\begin{tikzcd}
	0 & {K_0} & {L_0} & {M_0} & 0
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    Hence, as before, we can define an epimorphism \( P_1 \oplus R_1 \to L_0 \) making the two left-hand squares commute.
    % https://q.uiver.app/#q=WzAsMTQsWzQsMCwiQSJdLFs0LDEsIkIiXSxbNCwyLCJDIl0sWzMsMCwiUF8wIl0sWzIsMCwiS18wIl0sWzIsMiwiTV8wIl0sWzMsMiwiUl8wIl0sWzMsMSwiUF8wIFxcb3BsdXMgUl8wIl0sWzIsMSwiTF8wIl0sWzEsMiwiUl8xIl0sWzAsMiwiXFxjZG90cyJdLFswLDAsIlxcY2RvdHMiXSxbMSwwLCJQXzEiXSxbMSwxLCJQXzEgXFxvcGx1cyBSXzEiXSxbMCwxLCJmIl0sWzEsMiwiZyJdLFszLDAsImVfMSJdLFs0LDNdLFs1LDZdLFs2LDIsImVfMyJdLFszLDddLFs3LDZdLFs3LDEsImVfMiJdLFs0LDhdLFs4LDVdLFs4LDddLFs5LDVdLFsxMCw5XSxbMTIsNF0sWzExLDEyXSxbMTIsMTMsIlxcYmVnaW57cG1hdHJpeH0xIFxcXFwgMCBcXGVuZHtwbWF0cml4fSIsMl0sWzEzLDksIlxcYmVnaW57cG1hdHJpeH0wJjFcXGVuZHtwbWF0cml4fSIsMl0sWzEzLDhdXQ==
\[\begin{tikzcd}[ampersand replacement=\&]
	\cdots \& {P_1} \& {K_0} \& {P_0} \& A \\
	\& {P_1 \oplus R_1} \& {L_0} \& {P_0 \oplus R_0} \& B \\
	\cdots \& {R_1} \& {M_0} \& {R_0} \& C
	\arrow["f", from=1-5, to=2-5]
	\arrow["g", from=2-5, to=3-5]
	\arrow["{e_1}", from=1-4, to=1-5]
	\arrow[from=1-3, to=1-4]
	\arrow[from=3-3, to=3-4]
	\arrow["{e_3}", from=3-4, to=3-5]
	\arrow[from=1-4, to=2-4]
	\arrow[from=2-4, to=3-4]
	\arrow["{e_2}", from=2-4, to=2-5]
	\arrow[from=1-3, to=2-3]
	\arrow[from=2-3, to=3-3]
	\arrow[from=2-3, to=2-4]
	\arrow[from=3-2, to=3-3]
	\arrow[from=3-1, to=3-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-1, to=1-2]
	\arrow["{\begin{pmatrix}1 \\ 0 \end{pmatrix}}"', from=1-2, to=2-2]
	\arrow["{\begin{pmatrix}0&1\end{pmatrix}}"', from=2-2, to=3-2]
	\arrow[from=2-2, to=2-3]
\end{tikzcd}\]
    Continue by induction.
    As the columns
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiUF9uIl0sWzIsMCwiUV9uIl0sWzMsMCwiUl9uIl0sWzQsMCwiMCJdLFswLDFdLFsxLDJdLFsyLDNdLFszLDRdXQ==
\[\begin{tikzcd}
	0 & {P_n} & {Q_n} & {R_n} & 0
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    are biproduct diagrams, they are preserved by arbitrary additive functors.
\end{proof}
This proof does not show that \( Q_\bullet \cong P_\bullet \oplus R_\bullet \) in \( \textsc{c}\mathcal A \).
Indeed, if it were, then \( d_n' : Q_n \to Q_{n-1} \) would have matrix
\[ \begin{pmatrix} d_n & 0 \\ 0 & d_n'' \end{pmatrix} \]
where \( d_n : P_n \to P_{n-1} \) and \( d_n'' : R_n \to R_{n-1} \).
Our construction above was of the form
\[ \begin{pmatrix} d_n & x \\ 0 & d_n'' \end{pmatrix} \]
\begin{theorem}
    Let \( F : \mathcal A \to \mathcal B \) be an additive functor between abelian categories, and suppose \( \mathcal A \) has enough projectives.
    Then, for any short exact sequence
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiQSJdLFsyLDAsIkIiXSxbMywwLCJDIl0sWzQsMCwiMCJdLFswLDFdLFsxLDIsImYiXSxbMiwzLCJnIl0sWzMsNF1d
\[\begin{tikzcd}
	0 & A & B & C & 0
	\arrow[from=1-1, to=1-2]
	\arrow["f", from=1-2, to=1-3]
	\arrow["g", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    in \( \mathcal A \), we obtain an exact sequence
    % https://q.uiver.app/#q=WzAsOCxbNCwwLCJMXjBGQSJdLFs1LDAsIkxeMEZCIl0sWzYsMCwiTF4wRkMiXSxbNywwLCIwIl0sWzEsMCwiTF4xRkEiXSxbMiwwLCJMXjFGQiJdLFszLDAsIkxeMUZDIl0sWzAsMCwiXFxjZG90cyJdLFswLDFdLFsxLDJdLFsyLDNdLFs0LDVdLFs1LDZdLFs2LDBdLFs3LDRdXQ==
\[\begin{tikzcd}
	\cdots & {L^1FA} & {L^1FB} & {L^1FC} & {L^0FA} & {L^0FB} & {L^0FC} & 0
	\arrow[from=1-5, to=1-6]
	\arrow[from=1-6, to=1-7]
	\arrow[from=1-7, to=1-8]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=1-1, to=1-2]
\end{tikzcd}\]
\end{theorem}
\begin{proof}
    Choose projective resolutions \( P_\bullet, Q_\bullet, R_\bullet \) for \( A, B, C \) as above.
    Then applying \( F \), we obtain an exact sequence of complexes
    % https://q.uiver.app/#q=WzAsNSxbMCwwLCIwIl0sWzEsMCwiRlBfXFxidWxsZXQiXSxbMiwwLCJGUV9cXGJ1bGxldCJdLFszLDAsIkZSX1xcYnVsbGV0Il0sWzQsMCwiMCJdLFswLDFdLFsxLDJdLFsyLDNdLFszLDRdXQ==
\[\begin{tikzcd}
	0 & {FP_\bullet} & {FQ_\bullet} & {FR_\bullet} & 0
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd}\]
    in \( \mathcal B \).
    Then the result follows from the Mayer--Vietoris sequence.
\end{proof}
In particular, \( L^0F \) is always right exact, so \( L^0F \cong F \) if and only if \( F \) is right exact.
